package com.example.demo.service;

import com.example.demo.dto.DepartmentDTO;
import com.example.demo.entity.Department;
import com.example.demo.request.CreateDepartmentRequest;
import java.util.List;

public interface DepartmentService {

    /**
     * 分页查询部门列表
     */
    List<DepartmentDTO> getDepartments(int page, int size);

    /**
     * 获取部门总数
     */
    long countDepartments();

    /**
     * 根据 ID 查询部门详情
     */
    DepartmentDTO getDepartmentById(Integer id);

    /**
     * 创建新部门
     */
    Department createDepartment(CreateDepartmentRequest request);

    /**
     * 更新部门
     */
    void updateDepartment(Integer id, CreateDepartmentRequest request);

    /**
     * 删除部门
     */
    void deleteDepartment(Integer id);
    
    /**
     * 搜索部门（按名称）
     */
    List<DepartmentDTO> searchDepartmentsByName(String name);
}